/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package miniprojet.Models;

import java.util.ArrayList;

/**
 *
 * @author cynthia
 */
public class Piste {
    private static float echelleTemps = 0.1f;
        
    private float gain;
    private float frequence;
    private String fileName;
    
    private ArrayList<Byte> entete;
    private ArrayList<Canal> canaux;
    
    Piste()
    {
        this.entete = new ArrayList<Byte>();
        this.canaux = new ArrayList<Canal>();
    }
    Piste(int nombreCanaux)
    {
        this.entete = new ArrayList<Byte>();
        this.canaux = new ArrayList<Canal>(nombreCanaux);
    }
    
    Piste(float gain, float frequence, String fileName) //throws FileNotFoundException
    {
        this.gain = gain;
        this.frequence = frequence;
        this.fileName = fileName;
        
    }

    public void setEntete(ArrayList<Byte> entete) {
        this.entete = entete;
    }

    public ArrayList<Byte> getCanaux() {
        ArrayList<Byte> can = new ArrayList<Byte>();
        return can;
    }

    public ArrayList<Byte> getEntete() {
        return entete;
    }
    
    /**
     * Donne la quantité des canaux existants dans le piste
     * @return int nombre des canaux
     */
    public int getNombreCanaux()
    {
        return this.canaux.size();
    }
    
    // <editor-fold defaultstate="collapsed" desc="Manipulation de Fichier">
    public void ouvrir()
    {
        throw new UnsupportedOperationException("Not yet implemented");
    }
    
    public void fermer()
    {
//        try {
//            this.file.close();
//        } catch (IOException ex) {
//            Logger.getLogger(Piste.class.getName()).log(Level.SEVERE, null, ex);
//        }
    }

    public void lire()
    {
        throw new UnsupportedOperationException("Not yet implemented");
    }
    
    public void enregistrer()
    {
        throw new UnsupportedOperationException("Not yet implemented");
    }
    // </editor-fold>
    
    public void ajouterInfosCanaux(byte [] octets)
    {
        for(int i = 0; i < octets.length; i++)
        {
            byte octet = octets[i];
            this.canaux.get(i).ajouterOctet(octet);
        }
    }
    
    public void genererGraphic()
    {
        throw new UnsupportedOperationException("Not yet implemented");
    }
}
